﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Layout.Master" AutoEventWireup="true" CodeBehind="wfVisitDaily.aspx.cs" Inherits="Dragon.wfVisitDaily" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
    .auto-style4 {
    }
    .auto-style5 {
            width: 108px;
        }
    .auto-style6 {
        text-align: center;
        }
    .auto-style7 {
        width: 64px;
    }
        .auto-style8 {
            width: 85px;
        }
        .auto-style9 {
            width: 100%;
            border: 2px solid #0000FF;
        }
        .auto-style11 {
            width: 98px;
        }
        .auto-style15 {
            width: 153px;
        }
        .auto-style16 {
            width: 84px;
        }
        .auto-style17 {
            width: 110px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">    
    <table class="auto-style9" style="border-color: #666633">        
        <tr>
            <td class="auto-style8">Từngày</td>
            <td class="auto-style7">
                <asp:TextBox ID="txtFromDate" runat="server" Width="100px">01/06/2015</asp:TextBox>
                <cc1:CalendarExtender ID="txtFromDate_CalendarExtender" runat="server" BehaviorID="txtFromDate_CalendarExtender" TargetControlID="txtFromDate" Format="dd/MM/yyyy" />
            </td>
            <td class="auto-style5">Đến ngày</td>
            <td class="auto-style17">
                <asp:TextBox ID="txtToDate" runat="server" Width="100px">30/06/2015</asp:TextBox>
                <cc1:CalendarExtender ID="txtToDate_CalendarExtender" runat="server" BehaviorID="txtToDate_CalendarExtender" TargetControlID="txtToDate" Format="dd/MM/yyyy" />
            </td>
            <td class="auto-style16">
                Tỉnh thành</td>
            <td class="auto-style11">
                <cc1:ComboBox ID="ddlProvince" runat="server" DataSourceID="SqlDataSource2" DataTextField="Name" DataValueField="Code" DropDownStyle="DropDownList" MaxLength="0" style="display: inline; text-align: left;" Width="150px" OnDataBound="ProvinceOnDataBound" AutoPostBack="True">
                </cc1:ComboBox>
            </td>
            <td class="auto-style11">
                Tổ trưởng</td>
            <td class="auto-style15">
                <cc1:ComboBox ID="ddlBAS" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Code" DropDownStyle="DropDownList" MaxLength="0" style="display: inline; text-align: left;" Width="150px" OnDataBound="BASOnDataBound">
                </cc1:ComboBox>
            </td>
            <tr>
            <td class="auto-style6" colspan="8">
                <asp:Button ID="btnRunReport" runat="server" style="text-align: center" Text="Xem báo cáo" OnClick="btnRunReport_Click" />
            </td>
        </tr>
        <tr>
            <td class="auto-style4" colspan="8">                
                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" Height="550px" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
                    <LocalReport ReportPath="Report\rpVisitDaily.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="dsVisitDaily" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
            </td>
        </tr>
    </table>  
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CarlsbergConnectionString %>" SelectCommand="SELECT * FROM [BAS] WHERE ([Province] = @Province)">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlProvince" Name="Province" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CarlsbergConnectionString %>" SelectCommand="SELECT * FROM [Province] WHERE ([Status] = @Status)">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="Status" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="Dragon.Dataset.dsVisitDailyTableAdapters.ReportVisitDailyTableAdapter"></asp:ObjectDataSource>

    </asp:Content>
